﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AccidentCards
{
    public partial class AddDictElement : Form
    {
        public AddDictElement()
        {
            InitializeComponent();
        }

        private void AddDictElement_Load(object sender, EventArgs e)
        {
            for (int i = Convert.ToInt32(Dictionary.DictCategories.FirstCategory); i < Convert.ToInt32(Dictionary.DictCategories.LastCategory); i++)
            {
                cbCategory.Items.Add( Dictionary.CateroryNames[i]);                
            }
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            Dictionary.AddDictElement(cbCategory.SelectedIndex, Convert.ToInt32(elementOrder.Text), description.Text);
            this.Close();
        }
    }
}
